from app.database.connections import db
import MySQLdb


class Machine(db.Model):
    id = db.Column(db.BigInteger, primary_key=True)
    mac_code = db.Column(db.String)
    machine_name = db.Column(db.String)
    nick_name = db.Column(db.String)
    server_url_address = db.Column(db.String)
    yn = db.Column(db.Integer)

    def __init__(self,mac_code,machine_name,nick_name,server_url_address,yn):
        self.mac_code = mac_code
        self.machine_name = machine_name
        self.nick_name = nick_name
        self.server_url_address = server_url_address

    def __repr__(self):
        return '<machine: %r,%r,%r,%r >' % (self.id , self.mac_code , self.machine_name,self.server_url_address)